/*    */ package com.zimbra.cs.redolog.op;
/*    */ 
/*    */ import com.zimbra.cs.mailbox.MailItem.Type;
/*    */ import com.zimbra.cs.mailbox.Mailbox;
/*    */ import com.zimbra.cs.mailbox.MailboxManager;
/*    */ import com.zimbra.cs.mailbox.MailboxOperation;
/*    */ import com.zimbra.cs.redolog.RedoLogInput;
/*    */ import com.zimbra.cs.redolog.RedoLogOutput;
/*    */ import java.io.IOException;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class DateItem
/*    */   extends RedoableOp
/*    */ {
/*    */   private int mId;
/*    */   private MailItem.Type type;
/*    */   private long mDate;
/*    */   
/*    */   public DateItem()
/*    */   {
/* 38 */     super(MailboxOperation.DateItem);
/*    */   }
/*    */   
/*    */   public DateItem(int mailboxId, int itemId, MailItem.Type type, long date) {
/* 42 */     this();
/* 43 */     setMailboxId(mailboxId);
/* 44 */     this.mId = itemId;
/* 45 */     this.type = type;
/* 46 */     this.mDate = date;
/*    */   }
/*    */   
/*    */   protected String getPrintableData()
/*    */   {
/* 51 */     StringBuffer sb = new StringBuffer("id=").append(this.mId);
/* 52 */     sb.append(", date=").append(this.mDate);
/* 53 */     return sb.toString();
/*    */   }
/*    */   
/*    */   protected void serializeData(RedoLogOutput out) throws IOException
/*    */   {
/* 58 */     out.writeInt(this.mId);
/* 59 */     out.writeByte(this.type.toByte());
/* 60 */     out.writeLong(this.mDate);
/*    */   }
/*    */   
/*    */   protected void deserializeData(RedoLogInput in) throws IOException
/*    */   {
/* 65 */     this.mId = in.readInt();
/* 66 */     this.type = MailItem.Type.of(in.readByte());
/* 67 */     this.mDate = in.readLong();
/*    */   }
/*    */   
/*    */   public void redo() throws Exception
/*    */   {
/* 72 */     Mailbox mbox = MailboxManager.getInstance().getMailboxById(getMailboxId());
/* 73 */     mbox.setDate(getOperationContext(), this.mId, this.type, this.mDate);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/redolog/op/DateItem.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */